package com.yueka.mapper;

import com.yueka.pojo.honor.Honor;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface HonorMapper {
    @Select("SELECT id, honor_name, avatar, status, update_time, create_time FROM honor order by status")
    List<Honor> list();

    @Insert("INSERT INTO honor(honor_name, avatar, status, update_time, create_time) VALUES(#{honorName}, #{avatar}, #{status}, #{updateTime}, #{createTime})")
    void insert(Honor honor);

    @Update("UPDATE honor SET honor_name = #{honorName}, avatar = #{avatar}, status = #{status}, update_time = #{updateTime} WHERE id = #{id}")
    void update(Honor honor);

    @Delete("DELETE FROM honor WHERE id = #{id}")
    void delete(Integer id);

    @Select("SELECT id, honor_name, avatar, status, update_time, create_time FROM honor WHERE status = '1'")
    List<Honor> weblist();
}
